Skip to content

Add Python requirement extraction from docstrings and comments#1773

Open
AbarnaaSree wants to merge 1 commit into
Graphify-Labs:v8from
AbarnaaSree:feature/python-requirements
Open

Add Python requirement extraction from docstrings and comments#1773
AbarnaaSree wants to merge 1 commit into
Graphify-Labs:v8from
AbarnaaSree:feature/python-requirements

Conversation

@AbarnaaSree

@AbarnaaSree AbarnaaSree commented Jul 10, 2026

Copy link
Copy Markdown

Summary

This PR adds Python requirement extraction from docstrings and comments.

Changes

  • Added _extract_python_requirements() as a post-processing extraction pass.
  • Extracts requirement IDs (for example, SAFE-04) from Python docstrings and comments.
  • Creates requirement nodes with file_type = "concept".
  • Creates satisfies edges from the corresponding code symbol to the requirement node.
  • Preserves the existing rationale extraction behavior.

Testing

Added a unit test to verify requirement extraction from a function docstring.

Tests run:

pytest tests/test_rationale.py -q

Result:

19 passed

Related Issue

Related to #1320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant